
f=iter(open('src.html','r'))
g=iter(open('out.html','w'))
tag='<div class="'+input()+'">'
for line in f:
    if tag not in line:
        g.write(line)
    else:
        g.write(line)
        break
g.write(input('rewritten contents: '))
for line in f:
    if line != '    </div>':
        continue
    else:
        g.write(line)
for line in f:
    g.write(line)
f.close()
g.close()
